// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

import Game from "./Game";
import HardModeGame from "./HardModeGame";
import Lobby from "./Lobby";


const {ccclass, property} = cc._decorator;

@ccclass
export default class Welcome extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    onLoad () {

        this.node.on('touchstart', this.onClick, this);
    }

    start () {

    }

    onClick() {

        this.node.parent.active = false;

        if(Lobby.inst.gameMode == 0) {

            Game.inst.startGame();
        }
        else if (Lobby.inst.gameMode == 1){

            HardModeGame.inst.startHardModeGame();
        }
        
    }

    // update (dt) {}
}
